Skip to content

Conversation

@gmvar
Copy link

@gmvar gmvar commented Aug 22, 2025

Create the vim.languages.beancount module using bean-format and beancount-language-server.

Current Issues

  1. Formatting Behavior:

    • The beancount-language-server currently lacks an option to disable formatting. This results in documents being automatically formatted, even when the setting vim.languages.beancount.format.enable is set to false.
    • I have opened an issue on the project's GitHub repository requesting the addition of a toggle for this behavior. Until this feature is implemented, users will experience automatic formatting regardless of their preferences. GitHub Issue #650.
  2. Formatting Package Installation:

    • The vim.languages.beancount.format.enable setting does not install the necessary formatting package, which is bean-format. This package is included in pkgs.beancount.
    • The beancount-language-server also depends on pkgs.beancount, leading to a decision point regarding installation options. I would appreciate guidance on the preferred approach:
      1. Install pkgs.beancount to vim.extraPackages: This would ensure that the formatting package is available without requiring additional user setup.
      2. User-Managed PATH: Alternatively, users could be instructed to ensure that bean-format is available in their system PATH, similar to the current setup for the language server.

Sanity Checking

  • I have updated the changelog as per my changes
  • I have tested, and self-reviewed my code
  • My changes fit guidelines found in hacking nvf
  • Style and consistency
    • I ran Alejandra to format my code (nix fmt)
    • My code conforms to the editorconfig configuration of the project
    • My changes are consistent with the rest of the codebase
  • If new changes are particularly complex:
    • My code includes comments in particularly complex areas
    • I have added a section in the manual
    • (For breaking changes) I have included a migration guide
  • Package(s) built:
    • .#nix (default package)
    • .#maximal
    • .#docs-html (manual, must build)
    • .#docs-linkcheck (optional, please build if adding links)
  • Tested on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin

@github-actions
Copy link

github-actions bot commented Aug 22, 2025

🚀 Live preview deployed from da5c914

View it here:

Debug Information

Triggered by: gmvar

HEAD at: languages/beancount

Reruns: 1553

@gmvar gmvar force-pushed the languages/beancount branch from 0d75b65 to 8259788 Compare September 1, 2025 17:44
@gmvar gmvar marked this pull request as ready for review September 1, 2025 17:44
github-actions bot pushed a commit that referenced this pull request Sep 1, 2025
@gmvar gmvar force-pushed the languages/beancount branch from 8259788 to b38da6f Compare September 4, 2025 19:47
github-actions bot pushed a commit that referenced this pull request Sep 4, 2025
@gmvar gmvar force-pushed the languages/beancount branch from b38da6f to fa30514 Compare September 8, 2025 23:02
github-actions bot pushed a commit that referenced this pull request Sep 8, 2025
@horriblename horriblename force-pushed the v0.8 branch 2 times, most recently from 8b98f07 to ba9ce8b Compare September 13, 2025 07:23
@gmvar gmvar force-pushed the languages/beancount branch from fa30514 to aade359 Compare September 26, 2025 16:25
github-actions bot pushed a commit that referenced this pull request Sep 26, 2025
@gmvar gmvar requested a review from horriblename September 26, 2025 16:28
@gmvar gmvar force-pushed the languages/beancount branch from aade359 to 25c8b76 Compare October 5, 2025 02:28
github-actions bot pushed a commit that referenced this pull request Oct 5, 2025
@gmvar gmvar force-pushed the languages/beancount branch from 25c8b76 to c6e58f0 Compare October 30, 2025 17:03
github-actions bot pushed a commit that referenced this pull request Oct 30, 2025
Copy link
Owner

@NotAShelf NotAShelf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, I've meant to reply much earlier but kept forgetting each time. Two little comments before we can get this merged.

Comment on lines 50 to 55
::: {.note}
'beancount-language-server' requires 'bean-check' and 'bean-format'.
Both are provided by 'pkgs.beancount'. These binaries must be in
your PATH or in 'vim.extraPackages'. There are no additional checks
to verify if this requirement is met.
:::
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, this is what has been bothering me about this PR. Relying on packages being installed externally somehow is not something I'm very keen on. Ideally the beancount package should be wrapped here with the necessary dependencies in its path (via wrapProgram etc.) so that this warning is not necessary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to best use wrapProgram so I instead used writeShellScriptBin, the end result is the same and I tested everything works.

Please let me know what you think about this.

@gmvar gmvar force-pushed the languages/beancount branch from c6e58f0 to 08caf4d Compare November 1, 2025 00:05
Create the `vim.languages.beancount` module using `bean-format` and
`beancount-language-server`.
@gmvar gmvar force-pushed the languages/beancount branch from 08caf4d to 82b0452 Compare November 8, 2025 19:28
github-actions bot pushed a commit that referenced this pull request Nov 8, 2025
@gmvar gmvar requested a review from NotAShelf November 8, 2025 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants